<?php
namespace PsiFramework\Applications\AlloMediaPortal\Classes\Model;

import("Classes.Model.Object");
import("Applications.DefaultApp.Classes.Model.User");

use \PsiFramework\Applications\DefaultApp\Classes\Model\User;

/**
 * AlloMedia
 * Portail des professionnels
 *
 * @author Rémi San
 * @version beta
 */

/**
 * Classe d'un utilisateur d'un site web allomedia
 *
 * @package Model
 */
class AlloMediaUser extends User
{

    protected /*AlloMediaEntry[]*/     $_entries ;
    protected /*Date*/                 $_lastConnection;

    /**
     * User constructor
     *
     * @param     int        $id                the id (unique) of the user
     * @param     string    $login            the login of the user
     * @param     string    $password        the password of the user
     * @param     string    $email            the email of the user
     * @param     Gender    $gender            the gender of the user
     * @param     string    $firstName        the first name of the user
     * @param     string    $surName        the surname of the user
     * @param     string    $picture        the picture of the user
     * @param     Date    $birth            the birth of the user
     * @param     City    $city            the city of the user
     * @param     string    $text            the text of the user
     * @param     Date    $creationDate    the creation date
     * @param     bool    $activated        has the user been activated
     * @param     bool    $unsubscribed    has the user unsubscribed
     * @param     bool     $blocked        has the user been blocked
     * @return     User     instance
     */
    public function __construct(
        /*int*/ $id=null,
        /*string*/ $login=null,
        /*string*/ $password=null,
        /*string*/ $email=null,
        /*Gender*/ $gender=null,
        /*string*/ $firstName=null,
        /*string*/ $surName=null,
        /*string*/ $picture=null,
        /*date*/ $birth=null,
        /*City*/ $city=null,
        /*string*/ $address=null,
        /*string*/ $zipCode=null,
        /*string*/ $cityName=null,
        /*string*/ $text=null,
        /*Date*/ $creationDate=null,
        /*boolean*/ $activated=false,
        /*boolean*/ $unsubscribed=false,
        /*boolean*/ $blocked=false
    )
    {
        parent::__construct(
            $id,
            $login,
            $password,
            $email,
            $gender,
            $firstName,
            $surName,
            $picture,
            $birth,
            $city,
			$address,
			$zipCode,
			$cityName,
            $text,
            $creationDate,
            $activated,
            $unsubscribed,
            $blocked
        );
        $this->_entries = null ;
    }

    public function getEntries()
    {
        return $this->_entries ;
    }

    public function setEntries($entries)
    {
        $this->_entries = $entries ;
    }

    public function AddEntry($entry)
    {
        if (is_null($this->_entries)) {
        	$this->_entries = array();
        }
        $this->_entries[] = $entry ;
    }
    
    public function getLastConnection()
    {
    	return $this->_lastConnection ;
    }
    
    public function setLastConnection($lastConnection)
    {
    	$this->_lastConnection = $lastConnection ;
    }

}
